﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace mb
{
    class Token
    {
        private SortedDictionary<string, TotalCount> tokens;
        public Token()
        {
            tokens = new SortedDictionary<string, TotalCount>(StringComparer.CurrentCultureIgnoreCase);
        }
        public SortedDictionary<string, TotalCount> Tokens
        {
            get { return tokens; }
        }
        public int increaseCount(string key)
        {
            if (tokens.ContainsKey(key))
            {
                tokens[key].TCount++;
                return tokens[key].TCount;
            }
            else
                throw new Exception("Can not find the key in directory!");
        }
        public int increaseAppearence(string key)
        {
            if (tokens.ContainsKey(key))
            {
                tokens[key].TAppearance++;
                return tokens[key].TAppearance;
            }
            else
                throw new Exception("Can not find the key in directory!");
        }
    }
}
